import { Component, OnInit } from '@angular/core';
import {NavigationEnd, Router} from "@angular/router";
import 'rxjs/add/operator/filter'
@Component({
  selector: 'app-content',
  templateUrl: './content.component.html',
  styleUrls: ['./content.component.css']
})
export class ContentComponent implements OnInit {
  pageTitle:string='';
  pageTitleDes:string='';
  constructor( public  router : Router) {
    router.events.filter(event => event instanceof  NavigationEnd)
      .subscribe((event:NavigationEnd) =>{
      if(event.url =='/dubb'){
        this.pageTitle='首页'
        this.pageTitleDes='这是首页'
      }else if(event.url =='/stock'){
        this.pageTitle='管理'
        this.pageTitleDes='这是管理'
        }
      })
  }

  ngOnInit() {
  }

}
